package com.kasax.ipcbus.corel;

import java.util.concurrent.ConcurrentHashMap;

public class ObjectCenter {
    private static volatile ObjectCenter sInstance = new ObjectCenter();

    // 对象池
    private ConcurrentHashMap<String, Object> mObjectPool = new ConcurrentHashMap<>();

    private ObjectCenter() {

    }

    public static ObjectCenter getInstance() {
        return sInstance;
    }

    public Object getObject(String name) {
        return mObjectPool.get(name);
    }

    public void putObject(String name, Object obj) {
        mObjectPool.put(name, obj);
    }
}
